#ifndef __VISION_DEVICE_H__
#define __VISION_DEVICE_H__

#include "common/status.h"

#include <cstddef>
#include <string>

namespace vision
{

enum DeviceType {
    CPU = 0,
    OPENCL = 1,
    CUDA = 2,
    NPU = 3
}; // DeviceType

class Device {
public:
    size_t ID() const {return m_id; };
    virtual void* Alloc(const size_t bytes);
    virtual void Free(void* ptr);
    virtual Status CopyFromTo(Device& device, const char* from, char* to, const size_t bytes);
    virtual Status MapFromTo(Device& device, const char* from, char* to, const size_t bytes);

    std::string Name() const {return m_name; };
    DeviceType Type() const {return m_type; };

    Device(const size_t id, const std::string& name, const DeviceType type) : m_id(id), m_name(name), m_type(type) {}
    Device() : m_id(0), m_name(""), m_type(CPU) {}
    virtual ~Device() {}

private:
    size_t m_id; // device id
    std::string m_name;
    DeviceType m_type;
}; // class Device
} // namespace vision



#endif //__VISION_DEVICE_H__